package com.jackson.spring.beandemo.factorybean;

import org.springframework.beans.factory.FactoryBean;

/**
 * @author jackson
 *
 */
public class CarFactoryBean2 implements FactoryBean<Car> {

	private String brand;
	private double price;
	private int maxSpeed;
	private String style;

	// 返回bean的对象
	public Car getObject() throws Exception {
		return new Car(brand, price, maxSpeed, style);
	}

	//返回bean的类型
	public Class<?> getObjectType() {
		return Car.class;
	}

	//是否是单实例的
	public boolean isSingleton() {
		return true;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public int getMaxSpeed() {
		return maxSpeed;
	}

	public void setMaxSpeed(int maxSpeed) {
		this.maxSpeed = maxSpeed;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}
	

}
